import { Post } from '../../config.js'

class Api {
  /**
   * 用户提现列表
   * @param {object} params 参数对象
   * @desc {string} acc_id 身份验证参数,登陆时返回
   * @desc {string} page 页码
   * @desc {string} page_size 每页个数
   * @desc {string} search 查询
   * @desc {string} sort_field 排序字段
   * @desc {string} sort_type 0正序
   * @return {promise} api
   */
  userWithdrawList (params) {
    const data = {
      Copyright: 'v1',
      Interface: 'UserWithdraw',
      Command: 'userWithdrawList',
      Params: params
    }
    return Post(data)
  }
  /**
   * 修改提现状态
   * @param {object} params 参数对象
   * @desc {string} acc_id 身份验证参数,登陆时返回
   * @desc {string} ids 列表id
   * @desc {string} status 提现状态:0：申请已经提交，1：申请已经受理，2：转账已经完成，3：被驳回
   * @desc {string} reason 驳回理由:状态为3时，传理由，其余状态传''
   * @return {promise} api
   */
  alterUserWithdrawStatus (params) {
    const data = {
      Copyright: 'v1',
      Interface: 'UserWithdraw',
      Command: 'alterUserWithdrawStatus',
      Params: params
    }
    return Post(data)
  }
}

const FinanceWithdrawService = new Api()
export default FinanceWithdrawService
